<template>
	<el-container>
		<el-header>
			<div class="left-panel">
				<el-button type="primary" icon="el-icon-plus" @click="add"></el-button>
				<el-button type="danger" plain icon="el-icon-delete" :disabled="selection.length==0" @click="batch_del"></el-button>
			</div>
		</el-header>
		<el-main class="nopadding">
			<bydTable ref="table" :apiObj="apiObj" row-key="trackId" stripe border>
				<!-- <el-table-column type="selection" width="50"></el-table-column> -->
				<el-table-column label="序号" type="index" width="50"></el-table-column>
				<el-table-column label="申请单编号" prop="processId" width="150"></el-table-column>
				<el-table-column label="主题" prop="processName" min-width="300"></el-table-column>
				<el-table-column label="拟稿人"  prop="applyPeople" width="150"></el-table-column>
				<el-table-column label="申请时间" prop="applyTime" show-overflow-tooltip width="180"></el-table-column>
				<el-table-column label="接收时间" prop="receiveTime" width="180"></el-table-column>
				<el-table-column label="审批节点" prop="approveNode" width="300"></el-table-column>
				<el-table-column label="操作" fixed="right" align="right" width="120">
					<template #default="scope">
						<el-button type="text" size="small" @click="processShow(scope.row.trackId,scope.row.approvePeople)">审批</el-button>
					</template>
				</el-table-column>
			</bydTable>
		</el-main>
	</el-container>
	<el-drawer v-model="dialogView" :size="'70%'" title="流程详情" custom-class="drawerBG" direction="rtl" destroy-on-close>
		<processDetail :trackId="trackIdNow" :pageType="pageType"></processDetail>
	</el-drawer>
</template>

<script>
	import processDetail from '../processDetail'
	export default {
		name: "notDoPage",
		components:{processDetail},
		data(){
			return {
				apiObj: this.$api.process.notDoData,
				selection: [],
				dialogView:false,
				trackIdNow: '',
				pageType: 2,
			}
		},
		methods: {
			//审批
			async processShow(trackId,approvePeople){
				var param = {
					trackId : trackId
				}
				var info = await this.$api.process.processDetailInfo.get(param)
				const realApprovePeople = info.data.processInfo.approvePeople;
				var timePeopleList = realApprovePeople.split("-");
				if(timePeopleList[0] != approvePeople){
					this.$message.error("流程更新，请刷新重试");
				}else{
                    this.dialogView = true;
					this.trackIdNow = trackId;
				}
			},
		}
	}
</script>

<style>
</style>
